package com.xinxin.leetcode.problem226;

import com.xinxin.leetcode.common.TreeNode;

/**
 * @author ：史鑫鑫
 * @date ：Created in 2019/5/5 23:41
 */
class Solution {
    public TreeNode invertTree(TreeNode root) {
        if (root == null) {
            return root;
        }
        TreeNode left = invertTree(root.left);
        root.left = invertTree(root.right);
        root.right = left;
        return root;
    }
}
